/**
 * Runnable 匿名内部类来创建
 */
public class ThredDemo4 {
    public static void main(String[] args) {
        Thread thread = new Thread(new Runnable() {
            //直接用匿名内部类通关传参的方式创建
            @Override
            public void run() {
                Thread t = Thread.currentThread();
                System.out.println("执行任务："+t.getName());
            }
        });
        thread.start();
    }
}
